import {
    computed,
    defineComponent,
    onBeforeUnmount,
    onMounted,
    onUpdated,
    ref,
    Text,
    watch,
    watchEffect,
} from 'vue';
import   buttonProps  from './buttonType';
import type { VNode, Ref } from 'vue';
//获取全局
import useConfigInject  from "../utils/hooks/useConfigInject"
//样式
import  "./style/index.less"
const props = buttonProps();
//button组件
const Index= defineComponent({
    name:"Button",
    props,
    slot:["iocn"],
    emits:["clik"],
    setup(props, { slots, attrs, emit }) {
      const pre=`${useConfigInject().rootPrefix.value}-btn`;
        const classes = computed(() => {
            const { type, shape, size,  } = props;
            return {
                [`${pre}`]: true,
                [`${pre}-${type}`]: type,
                [`${pre}-${shape}`]: shape,
                [`${pre}-${size}`]: size,
            };
        });
        const   cla= [
            classes.value,
            attrs.class,
        ];
     return ()=> <>
       <button class={cla} ></button>
     </>
    }
})
export  default Index;
